gl: Put shaders in static storage
authorEmmanuele Bassi <ebassi@gnome.org>
Tue, 10 Feb 2015 03:33:02 +0000 (03:33 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Tue, 10 Feb 2015 03:33:02 +0000 (03:33 +0000)
We are not changing the shader code.

The compiler will hopefully put them in the .rodata section.

gdk/gdkgl.c

index e497ccc910be051ac6a15b91e50e21604db6818a..1d7d2d4bb929a0f6eaed3d7d5bd0af4c7aab18b0 100644 (file)
@@ -146,7 +146,7 @@ bind_vao (GdkGLContextPaintData *paint_data)
 static void
 use_texture_2d_program (GdkGLContextPaintData *paint_data)
 {
-  const char *vertex_shader_code =
+  static const char *vertex_shader_code =
     "#version 150\n"
     "uniform sampler2D map;"
     "attribute vec2 position;\n"
@@ -156,7 +156,7 @@ use_texture_2d_program (GdkGLContextPaintData *paint_data)
     "  gl_Position = vec4(position, 0, 1);\n"
     "  vUv = uv;\n"
     "}\n";
-  const char *fragment_shader_code =
+  static const char *fragment_shader_code =
     "#version 150\n"
     "varying vec2 vUv;\n"
     "uniform sampler2D map;\n"
@@ -177,7 +177,7 @@ use_texture_2d_program (GdkGLContextPaintData *paint_data)
 static void
 use_texture_rect_program (GdkGLContextPaintData *paint_data)
 {
-  const char *vertex_shader_code =
+  static const char *vertex_shader_code =
     "#version 150\n"
     "uniform sampler2DRect map;"
     "attribute vec2 position;\n"
@@ -187,7 +187,7 @@ use_texture_rect_program (GdkGLContextPaintData *paint_data)
     "  gl_Position = vec4(position, 0, 1);\n"
     "  vUv = uv;\n"
     "}\n";
-  const char *fragment_shader_code =
+  static const char *fragment_shader_code =
     "#version 150\n"
     "varying vec2 vUv;\n"
     "uniform sampler2DRect map;\n"